﻿module FSvars

open System

(* Ask for l from Ibrahim, W is a set of words with length 'l'
All logs are log2.
Otherwise l_default = [c1*log n + c2*k] + k
    where c1 = 2 + delta && c_star = c1 / ((c1 - 2)*ln(2)) && c2 = (c1 / 2)*{log(c_star) + 2.5 - 1/ln(2)
    (can modify delta so that l_default matches Ibrahim's integer)

Y or X are simply DNA sequences (DNA words) or binary sequences.
H(X,Y) = number of positions where X and Y differ
k_# is between 0 and l.

What are i and j? AND
IS it is expected that i and j are equivalent? If so, change the formulas below:



*)

//    CheckE1
//    Console.ReadKey(false)

// RECEIVE FROM DETWORDS:
//let k1 = new DetWordsModel.k1<int>
//let k4 = new DetWordsModel.k4<int>
//let delta = new DetWordsModel.delta
//let n = new DetWordsModel.n
//let l = new DetWordsModel.l

let genBinary = (System.Random()).Next(2)
// let giveBin = new genBinary() // new creates types not instances as in C#, what to do here?

let initMatrix n l = Array2D.zeroCreate<int> n l
// let M = initMatrix |> Array2D.map(fun x -> giveBin) // giveBin is confused here

let c1 delta = 2.0 + delta
let c_star c1 = c1 / ((c1 - 2.0) * log 2.0)
let c2 c1 c_star = (c1 / 2.0) * ((log c_star) / (log 2.0)) + 2.5 - (1.0 / (log 2.0))
let k k1 k4 = max k1 k4
let l_star n k c1 c2 = int (ceil(c1*((log n) / (log 2.0)) + c2*k))
let l = l_star

// let H_fx a b = countmeinheresomewhere (COUNTS ALL MATCHES)
//C1(k1): H(Y,X) >= k1 
//C4(k4): H(Y[1..i],X[(l-i+1)..l]) >= k4 - (l-i) for all (l >= i >= l - k4)